// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

const { TOUCH_START } = cc.Node.EventType;

@ccclass
export default class NewClass extends cc.Component {

    onLoad () {
        // this.node.on(TOUCH_START, () => {
        //     cc.director.loadScene('main_scene')
        // })

        const actest = this.node.parent.getChildByName('ActionTest')
        
        this.node.on(TOUCH_START, function(){
            // const sq = cc.sequence(
            //     cc.moveBy(0.5, 200, 0),
            //     cc.moveBy(0.5, -200, 0)
            // )
            // actest.runAction(sq)

            // const sq = cc.spawn(
            //     cc.moveBy(0.5, 200, 0),
            //     cc.scaleTo(0.5, 0.8)
            // )
            
        }, this)
        
    }

    start () {

    }

    onBtnClick(arg, data){
        console.log(data)
    }

    // update (dt) {}
}
